<!--
Copyright © 2017, Che-Wei Hsu <cwxhsu@gmail.com>
This file is part of the MintCM.
Some rights reserved. See README.
-->

<html>

<head>

<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="jquery_main.js"></script>
<script type="text/javascript" src="json3.js"></script>
<script type="text/javascript" src="mcm_jslib_api.js"></script>
<script type="text/javascript" src="mcm_jslib_data_info_auto.js"></script>
<link rel="stylesheet" href="web_app_0504_style.css">

<script type="text/javascript">
function do_test()
{
    var self_jslib, req_cmd, rep_ret, mcm_dv;


    // 執行多個內部模組, 只會得到最後一個被執行的內部模組的訊息,
    // mcm_module_obtain_multiple_test_01() 設定錯誤會馬上返回不會繼續處理指令,
    // 所以 mcm_module_obtain_multiple_test_02() 不會被執行到.
    req_cmd = "&run.mcm_module_obtain_multiple_test_01" +
              "&run.mcm_module_obtain_multiple_test_02" +
              "&get.device.system";

    self_jslib = new mcm_jslib_lib_t();
    self_jslib.socket_path = "@mintcm";
    self_jslib.session_permission = mcm_session_permission.ro;
    self_jslib.session_stack_size = 0;
    self_jslib.request_command = req_cmd;
    self_jslib.data_format = mcm_data_format.all_default;
    self_jslib.other_query = "";
    rep_ret = mcm_jslib_obtain_config(self_jslib);
    if(rep_ret.rep_code < mcm_return_code.pass)
    {
        alert("call mcm_jslib_obtain_config() fail" +
              "[" + rep_ret.rep_code + "]");
        mcm_jslib_run_script(rep_ret.rep_data);
        return;
    }
    mcm_dv = JSON.parse(rep_ret.rep_data);
}
</script>

</head>

<body>

  <div>[obtain_config]<br>[multiple module]</div>

  <button type="button" onclick="do_test()">test</button>

</body>

</html>
